package com.tgc;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author gjl
 * 2017/9/18
 */
@EnableAutoConfiguration
@SpringBootApplication
@EnableTransactionManagement
@ComponentScan
@MapperScan("com.tgc.**.dao")
public class Application {

    private static Logger logger = LoggerFactory.getLogger(Application.class);

    @Bean
    public Object testBean(PlatformTransactionManager platformTransactionManager){
        logger.info("============= " + platformTransactionManager.getClass().getName() + " =============");
        return new Object();
    }

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
        logger.info("============= SpringBoot Start Success =============");
    }
}
